<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>Document</title>
    <style>
        .sum span,.total span{color: red; font-weight: bold; }
    </style>
    <script src="jquery.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function(){
        var input=$('.bb input[name=aa]'); 
        var total=0
         input.blur(function(){
                total =(input.val()*1);
                $('.sum span').html(total);
            });
    });

    function add(){
        var sum=$('.bb p').length+1;
            $('.add').before('<p>第<span class="row_'+sum+'">'+sum+
                '</span>个 <input type="text" name="aa" value=""><a class="del" href="javascript:;" onclick="del(this);">删除</a> </p>');
            var input=$('.bb input[name=aa]'); 
            var total=0;
            input.blur(function(){
            for(var i =0;i < input.length;i++){
                total +=(input.eq(i).val()*1);
                }
                $('.sum span').html(total);
            }); 
    }

    function del(){
        $(obj).parents("p").remove(); 

    }
    </script>
    </head>
    <body>
    <div class="bb">
        <p>第1个<input type="text" name="aa" value="" /></p>
        <a href="javascript:;" class="add" onclick="add();">点此增加个数</a>
    </div>
    <br>
    <div class="sum">总个数：<span s>0</span>个</div>
    <br>
    <div class="money">
        单价：<input type="text" name="aa" value="" />
    </div>
    <br>
    <div class="total">
        总个数*单价：<span>0</span>元
    </div>
    </body>
    </html>
    
</body>
</html>